package util;

import java.io.StringReader;

import ast.ExpressionNode;

import parser.Parser;
import parser.ParserFactory;

public class Driver {
	
	public static String evaluate(String expression) throws Exception {
		StringReader reader = new StringReader(expression);
		Parser parser = (ParserFactory.INSTANCE).newParser(reader);
		ExpressionNode exp = parser.parse();
		return Long.toString(exp.collapseExp());
	}

}
